<template>
  <div>
    <button @click="open">显示loading</button>
    <!-- <button @click="close">关闭loading</button> -->
    <button @click="getData">发送请求</button>
  </div>
</template>

<script>
import { getBanner } from "../utils/api/api";
export default {
  data() {
    return {};
  },
  methods: {
    open() {
      this.$loading.show();
      setTimeout(() => {
        this.$loading.hide();
      }, 2000);
    },
    getData() {
      getBanner().then((res) => {
        console.log(res);
      });
    },
  },
  created() {},
  mounted() {},

  computed: {},
  watch: {},
};
</script>

<style lang="scss" scoped></style>
